package com.chf.springboot_test_thymeleaf.service.Impl;

import com.chf.springboot_test_thymeleaf.beans.Student;
import com.chf.springboot_test_thymeleaf.dao.UserDao;
import com.chf.springboot_test_thymeleaf.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService implements IUserService {
    @Autowired
    UserDao dao;
    @Override
    public List<Student> QueryAllUserInfo(){
        return dao.QueryAllUserInfo();
    }

    @Override
    public Student QueryUserInfo(Integer id) {
        return dao.QueryUserInfoById(id);
    }

    @Override
    public int DeleteUserInfo(Integer id) {
        return dao.DeleteUserInfo(id);
    }

    @Override
    public int UpdateUserInfo(Student student) {
        return dao.UpdateUserInfo(student);
    }

    @Override
    public int InsertUserInfo(Student student) {
        return dao.InsertUserInfo(student);
    }

    @Override
    public boolean Login(Student student) {
        Student student1 = dao.Login(student);
        return student1 != null;
    }
}
